package com.kaishengit.service;

import com.kaishengit.dao.DocumentDao;
import com.kaishengit.entity.Document;
import com.kaishengit.util.StringUtil;
import com.kaishengit.util.db.Page;


public class DocumentService {
	DocumentDao dao = new DocumentDao();
	public void save(String title, String content, String projectid,
			String employeeid) {
		Document document = new Document();
		document.setId(StringUtil.getId());
		document.setTitle(title);
		document.setContent(content);
		document.setEmployeeid(employeeid);
		document.setProjectid(projectid);
		dao.save(document);
		
	}
	public Page<Document> findByPageAndProjectId(int pageNum, String projectid) {
		return dao.findByPageAndProjectId(pageNum,  projectid);
	}
	public Document findById(String id) {
		
		return dao.findById(id);
	}
	public void update(String id, String title, String content) {
		 dao.update(id,title,content);
	
		
	}
	public void del(String id) {
		dao.del(id);
		
	}
	public com.kaishengit.entity.Document findAllById(String id) {
		
		return dao.findAllById(id);
	}
}
